import 'package:backend.core/core/domain/entities/api/google_play/api_google_play_purchased_subscription_transaction_offer_type.dart';
import 'package:backend.core/core/domain/entities/google_play/google_play_purchased_subscription_transaction_offer_type.dart';

abstract class CreateApiGooglePlayPurchasedSubscriptionTransactionOfferTypeFromInternalOne {
  ApiGooglePlayPurchasedSubscriptionTransactionOfferType call({
    required GooglePlayPurchasedSubscriptionTransactionOfferType offerType,
  });
}

class CreateApiGooglePlayPurchasedSubscriptionTransactionOfferTypeFromInternalOneImpl
    implements CreateApiGooglePlayPurchasedSubscriptionTransactionOfferTypeFromInternalOne {
  const CreateApiGooglePlayPurchasedSubscriptionTransactionOfferTypeFromInternalOneImpl();

  @override
  ApiGooglePlayPurchasedSubscriptionTransactionOfferType call({
    required GooglePlayPurchasedSubscriptionTransactionOfferType offerType,
  }) {
    switch (offerType) {
      case GooglePlayPurchasedSubscriptionTransactionOfferType.trialPeriod:
        return ApiGooglePlayPurchasedSubscriptionTransactionOfferType.trialPeriod;
      case GooglePlayPurchasedSubscriptionTransactionOfferType.promotional:
        return ApiGooglePlayPurchasedSubscriptionTransactionOfferType.promotional;
      case GooglePlayPurchasedSubscriptionTransactionOfferType.regular:
        return ApiGooglePlayPurchasedSubscriptionTransactionOfferType.regular;
    }
  }
}
